// 定义组件描述符的接口，用于描述每个组件的路径和属性等信息
export interface ComponentDescriptor {
  path: string
  attrs?: string[] // 可选属性数组
  characterDelta?: number // 可选的字符偏移量，用于调整光标位置
  closeSelf?: boolean // 是否自闭合标志
}


// 定义组件映射，将组件名称映射到对应的组件描述符
export const componentsMap: Record<string, ComponentDescriptor> = {
  table: {
    path: '/pro_table',
    attrs: [':request="request"', ':map="map"', ':columns="columns"'],
  },
  'table-edit': {
    path: '/pro_table_edit',
    attrs: [':request="request"', ':map="map"', 'v-model=""'],
    characterDelta: -2,
  },
  form: {
    path: '/pro_form',
    attrs: [':ref="formRef"', ':columns="columns"', 'v-model=""'],
    characterDelta: -2,
  },
  search: {
    path: '/pro_search',
    attrs: [':columns="columns"', 'v-model=""'],
    characterDelta: -2,
  },
  select: {
    path: '/pro_select',
    attrs: [':list="list"', ':map="map"', 'v-model=""'],
    characterDelta: -2,
  },
  checkbox: {
    path: '/pro_checkbox',
    attrs: [':list="list"', ':map="map"', 'v-model=""'],
    characterDelta: -2,
  },
  footer: {
    path: '/pro_footer',
    closeSelf: true
  }
}
